client/proc

/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*
///    Window Setters        ///
*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/

	setStyle(style)
		winset(src,"Main_Output.Output","style=\"body{font-family:[style]}\"")

	adjustInterface()
		winset(src,"Main","size=690x450")
		src.adjustWholist(WhoSide)
		src.setOutput(src.Max_Lines)
		src.setStyle(src.Output_Style)

	adjustWholist(side)
		if(side) winset(src,"Main.MainChild","splitter=80;left=Main_Output;right=Main_Sidebar")
		else winset(src,"Main.MainChild","splitter=20;left=Main_Sidebar;right=Main_Output")

	setOutput(number)
		winset(src,"Main_Output.Output","max-lines=[number]")

/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*
///    Loading Procedures    ///
*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/

	loadSettings()
		if(!src.Colors) winset(src,"Main_Settings.togglecolors_off","is-checked=true")

		if(src.WhoSide) winset(src,"Main_Settings.userlist_right","is-checked=true")
		else winset(src,"Main.MainChild","splitter=20")

		winset(src,"Main_Settings.outputstyle","text=\"[src.Output_Style]\"")
		winset(src,"Main_Settings.namecolor","text=\"[src.Name_Color]\";text-color=#[src.Name_Color]")
		winset(src,"Main_Settings.textcolor","text=\"[src.Text_Color]\";text-color=#[src.Text_Color]")

		winset(src,"Main_Settings.hour","text=\"[src.HOUR_Offset]\"")
		winset(src,"Main_Settings.minute","text=\"[src.MIN_Offset]\"")
		winset(src,"Main_Settings.second","text=\"[src.SEC_Offset]\"")

		winset(src,"Main_Settings.maxlines","text=\"[src.Max_Lines]\"")

		if(!src.IM_ENABLE) winset(src,"Main_Settings.im_off","is-checked=true")
		else winset(src,"Main_Settings.im_on","is-checked=true")

		if(winget(src,"Main_Settings.message","is-visible") == "true")
			spawn(1*SECOND) winset(src,"Main_Settings.message","is-visible=false")

		winset(src,"Main_Settings.name","text=\"[src.User_Name]\"")

		if(src.User_Gender == "Male")
			winset(src,"Main_Settings.gender_male","is-checked=true")
		else
			winset(src,"Main_Settings.gender_female","is-checked=true")

		winset(src,"Main_Settings.age","text=\"[src.User_Age]\"")

		winset(src,"Main_Settings.location","text=\"[src.User_Location]\"")

		if(src.User_Image)
			winset(src,"Main_Settings.image","text=\"[src.User_Image]\"")
			winset(src,"Main_Settings.imageView","image=\"[src.User_Image]\";image-mode=stretch")

		winset(src,"Main_Settings.messenger","text=\"[src.User_Messenger]\"")
		winset(src,"Main_Settings.contact","text=\"[src.User_Contact]\"")

/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*
///    Ignore Functions      ///
*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/


	ignorePerson(var/person as text, var/option as num|null)
		set hidden = 1
		if(option)
			src.Ignored-=person
			System_UserMessage(src, "You are no longer ignoring [person].")
		else
			src.Ignored+=person
			System_UserMessage(src, "You are now ignoring [person].")

		src.ignoreLists()


	ignoreLists()
		var
			style = "font-weight: bold; font-size: 12px;"
			style2 = "text-align: center;"

		while(winget(src,"Main_Ignorelist","is-visible") == "true")
			var
				irow = 1
				urow = 1


			// Ignore Grid
			src<<output("<span style=\"[style][style2]\">Chatter</span>","Main_Ignorelist.ignoregrid:1,[irow]")
			src<<output("<span style=\"[style]\">Button</span>","Main_Ignorelist.ignoregrid:3,[irow]")
			irow++

			for(var/client/C in Everyone)
				src<<output("[C.name]","Main_Ignorelist.ignoregrid:1,[irow]")
				if(C.name in Ignored) src<<output(User_Unignore,"Main_Ignorelist.ignoregrid:3,[irow]")
				else src<<output(User_Ignore,"Main_Ignorelist.ignoregrid:3,[irow]")
				irow++


			// Unignore Grid
			src<<output("<span style=\"[style][style2]\">Chatter</span>","Main_Ignorelist.unignoregrid:1,[urow]")
			src<<output("<span style=\"[style]\">Button</span>","Main_Ignorelist.unignoregrid:3,[urow]")
			urow++

			for(var/C in src.Ignored)
				src<<output("[C]","Main_Ignorelist.unignoregrid:1,[urow]")
				if(C in Ignored) src<<output(User_Unignore,"Main_Ignorelist.unignoregrid:3,[urow]")
				urow++

			winset(src,"Main_Ignorelist.ignoregrid","cells=3x[irow-1]")
			winset(src,"Main_Ignorelist.unignoregrid","cells=3x[urow-1]")

			sleep(1*SECOND)




obj
	Interface
		icon='buttons.dmi'
		Ignore
			icon_state="mute"
			Click(var/V)
				..()
				var/row = copytext(V,findtext(V,",")+1,0)
				row = text2num(row)-1
				if(row > 0 && row <= length(Everyone))
					var/client/person = Everyone[row]
					person = person.key
					usr.client.ignorePerson(person)

		UnIgnore
			icon_state="unmute"
			Click(var/V)
				..()
				var/row = copytext(V,findtext(V,",")+1,0)
				row = text2num(row)-1
				if(row > 0 && row <= length(usr.client.Ignored))
					var/client/person = usr.client.Ignored[row]
					usr.client.ignorePerson(person, 1)


var/obj/Interface/User_Ignore = new/obj/Interface/Ignore
var/obj/Interface/User_Unignore = new/obj/Interface/UnIgnore




client/verb

/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*
///    Save Function         ///
*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/

	saveSettings()
		set hidden = 1

		winset(src,"Main_Settings.message","is-visible=true")

		var/colors = winget(src,"Main_Settings.togglecolors_on","is-checked")
		var/whoside = winget(src,"Main_Settings.userlist_left","is-checked")

		if(colors == "true") src.Colors = 1
		else src.Colors = 0
		if(whoside == "true") src.WhoSide = 0
		else src.WhoSide = 1

		var/IMs = winget(src,"Main_Settings.im_on","is-checked")
		if(IMs == "true") src.IM_ENABLE = 1
		else src.IM_ENABLE = 0

		src.adjustWholist(WhoSide)

		src.Output_Style = winget(src,"Main_Settings.outputstyle","text")
		src.Name_Color = winget(src,"Main_Settings.namecolor","text")
		src.Text_Color = winget(src,"Main_Settings.textcolor","text")

		src.HOUR_Offset = text2num(winget(src,"Main_Settings.hour","text"))
		src.MIN_Offset = text2num(winget(src,"Main_Settings.minute","text"))
		src.SEC_Offset = text2num(winget(src,"Main_Settings.second","text"))

		src.Max_Lines = text2num(winget(src,"Main_Settings.maxlines","text"))
		src.setOutput(src.Max_Lines)
		src.setStyle(src.Output_Style)

		if(winget(src,"Main_Settings.telnetsave","is-checked") == "true")
			var/password = winget(src,"Main_Settings.telnetpassword","text")
			var/command = winget(src,"Main_Settings.dtc","text")

			if(istext(password) && istext(command))
				if(!TelnetInfo) TelnetInfo = new
				TelnetInfo[src.ckey] = list("pwd" = password, "cmd" = command, "uname" = src.key)

		winset(src,"Main_Settings.message","is-visible=true")
		var/image = winget(src,"Main_Settings.image","text")
		if(image == "") image = getImage(src.ckey)
		var/name = winget(src,"Main_Settings.name","text")
		var/gender = "Male"
		if(winget(src,"Main_Settings.gender_female","is-checked") == "true")
			gender = "Female"
		var/age = winget(src,"Main_Settings.age","text")
		var/location = winget(src,"Main_Settings.location","text")
		var/contact = winget(src,"Main_Settings.contact","text")
		var/messenger = winget(src,"Main_Settings.messenger","text")

		src.User_Name = name
		src.User_Gender = gender
		src.User_Age = age
		src.User_Image = image
		src.User_Location = location
		src.User_Contact = contact
		src.User_Messenger = messenger

		src.loadSettings()
		src.updateProfiles()
		src.SaveMe()